#!/bin/bash

# echo "Initial bench info generation..."
# array=("b17" "dsp" "DMA_fast" "b18" "des_perf_fast" "b22")
# for var in ${array[@]}
# do
#     echo "running $var"
#     log_name="LOGs/log_"$var"_init"
#     echo "log name is $log_name"
#     if [ "$var" != "b22" ]
#     then
#         ./HSTA_full_flow.sh $var 0 0 7 0 &> $log_name &
#     else
#         ./HSTA_full_flow.sh $var 0 -1 7 0 &> $log_name &
#     fi
# done

# exit 

#original: 
#0: gold 1:pred 2:avg 3:srr (1 and 3 use the same prediction strategy)
#now
#0: srr (abandoned) 1:gold 2:avg 3:pred 4: bc 5:wc

#array=("b17" "dsp" "DMA_fast" "b18" "des_perf_fast" "b22")
#array=("DMA_fast" "b17" "dsp" "b22")
#array=("DMA_fast" "b17")
#array=("dsp" "b18")
array=("S35932")
#isp_array=( 2 3 5 )
for isp in 1
#for isp in "${isp_array[@]}"
#for isp in {1..5}
do
for sid in 2
#for sid in {6..7}
do
pids=
for var in ${array[@]}
do
    echo "running $var"
    log_name="LOGs/log_"$var"_"$sid"_"$isp
    echo "log name is $log_name"
    if [ "$var" != "b22" ]
    then
        ./HSTA_full_flow.sh $var 1 0 $sid $isp &> $log_name &
    else
        ./HSTA_full_flow.sh $var 1 -1 $sid $isp &> $log_name &
    fi
    pids="$pids $!"
done
wait $pids
echo "loop done!"
done
done

exit

array=("b18" "des_perf_fast")
#for isp in 0
for isp in {3..5}
do
#for sid in 1
for sid in {2..10}
do
pids=
for var in ${array[@]}
do
    echo "running $var"
    log_name="LOGs/log_"$var"_"$sid"_"$isp
    echo "log name is $log_name"
    if [ "$var" != "b22" ]
    then
        ./HSTA_full_flow.sh $var 1 0 $sid $isp &> $log_name &
    else
        ./HSTA_full_flow.sh $var 1 -1 $sid $isp &> $log_name &
    fi
    pids="$pids $!"
done
wait $pids
echo "loop done!"
done
done
